package com.training.admin.service;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.demo2do.core.entity.page.Page;
import com.training.admin.entity.project.Project;
import com.training.admin.entity.project.ProjectTrainee;
import com.training.admin.entity.trainee.Trainee;

/**
 * 
 * @author Rockett
 *
 */
/**
 * @author xiaoHU
 *
 */
public interface ProjectTraineeService extends DataService<ProjectTrainee>{
    
    /**
     * check if trainees is assigned to a project
     * @param projectId
     * @param traineeId
     * @return
     */
    public int countByProjectAndTraineeId(Long projectId,Long traineeId);
	
	/**
	 * get all trainees for a project
	 * @param projectId
	 * @return
	 */
	public List<ProjectTrainee> listByProjectId(Long projectId);
	
	
	
	/**
	 * count for page
	 * @param projectId
	 * @return
	 */
	public int countByProjectId(Long projectId);
	
	/**
     * list trainees for a project by page
     * @param projectId
     * @return
     */
    public List<ProjectTrainee> listByProjectId(Long projectId,Page page);

	/**
	 * 结业学员数
	 * @param projectId
	 * @return
	 */
	public int countCompletedTraineeByProjectId(Long projectId);
	
	/**
	 * 上传学员
	 * @param file
	 * @return
	 */
	public Map<String, Object> createByFile (MultipartFile file,Project project);
	
	/**
	 * 
	 * @param project
	 * @param traineeIds
	 */
	public void create(Project project, List<Long> traineeIds);
	
	/**
	 * 
	 * @param projectId
	 * @return
	 */
	public List<Trainee> listTrainee(Long projectId);

    /**
     * @param file
     * @param project
     * @param projectPhaseId
     */
    public void updateProjectTraineeByFile(MultipartFile file, Project project, Long projectPhaseId);
    
    /**
     * 
     * @param projectTrainee
     * @param trainee
     * @param projectPhaseId
     */
    public void editProjectTrainee(ProjectTrainee projectTrainee, Trainee trainee, Long projectPhaseId);

    /**
     * @param project
     * @return
     */
    public int countByProject(Project project);

    /**
     * @param project
     * @param page
     * @return
     */
    public List<ProjectTrainee> listByProject(Project project, Page page);
    
    /**
     * 
     * @param project
     * @param trainee
     * @return
     */
    public ProjectTrainee load(Project project, Trainee trainee);
    
}
